package Huihu.src.刷题;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class 统计字符 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        Map<String, Integer> result = new HashMap<>();//双链结构
        char[] chars = str.toCharArray();
        int dig = 0;//数字计数
        int blank = 0;//空格
        int word = 0;//字母
        int other = 0;//其他字符
        for (char ch : chars) {
            if (Character.isLetter(ch)) {//判断是否为数字
                word++;
            } else if (Character.isDigit(ch)) {//判断是否为空格
                dig++;
            } else if (Character.isSpaceChar(ch)) {//判断是否为字母
                blank++;
            } else {
                other++;
            }
        }
        result.put("dig", dig);
        result.put("blank", blank);
        result.put("word", word);
        result.put("other", other);
        System.out.println(dig);
        System.out.println(blank);
        System.out.println(word);
        System.out.println(other);
    }
}
